package com.ilink.dataanalysis.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface CourseMapper {
    @Select("SELECT stc.course_name FROM study_teacher_courses stc " +
            "JOIN coursesource cs ON stc.course_id = cs.course_id " +
            "WHERE cs.coursesource_id = #{courseSourceId}")
    String getCourseNameByCourseSourceId(@Param("courseSourceId") Long courseSourceId);

    @Select("SELECT course_id FROM coursesource WHERE coursesource_id = #{courseSourceId}")
    Long getCourseIdByCourseSourceId(@Param("courseSourceId") Long courseSourceId);
}
